<h2><{$smarty.const._MD_D3DOWNLOADS_CATEGORYEDITTITLE}></h2>
<form name="categoryform" id="categoryform" action="<{$mod_url}>/admin/index.php?page=<{$page}>&amp;cid=<{$cid}>" method="post" onsubmit="return xoopsFormValidate_contentform();">
	<{$gticket_hidden}>
	<input type="hidden" name="cid" value="<{$categorydata.cid}>" />
	<table class="outer">
		<tr valign="top" align="left">
			<td class="head"><label for="title"><{$smarty.const._MD_D3DOWNLOADS_CATEGORYTITLE}></label></td>
			<td class="even">
				<input type="text" name="title" id="title" size="50" maxlength="50" value="<{$categorydata.title}>" />
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><label for="imgurl"><{$smarty.const._MD_D3DOWNLOADS_CATEGORYIMGURL}></label><br />
			<{$smarty.const._MD_D3DOWNLOADS_CATEGORYIMGURLDESC}></td>
			<td class="even">
				<{if $categorydata.imgurl}>
					<input type="text" name="imgurl" id="imgurl" size="100" maxlength="150" value="<{$categorydata.imgurl}>" />
				<{else}>
					<input type="text" name="imgurl" id="imgurl" size="100" maxlength="150" value="http://" />
				<{/if}>
			</td>
		</tr>
		<{if $can_selectshotsdir}>
			<tr valign="top" align="left">
				<td class="head"><label for="shotsdir"><{$smarty.const._MD_D3DOWNLOADS_CATEGORYSHOTSDIR}></label><br />
				<{$smarty.const._MD_D3DOWNLOADS_CATEGORYSHOTSDIRDESC}></label>
				<td class="even">
					<input type="text" name="shotsdir" id="shotsdir" size="100" maxlength="150" value="<{$categorydata.shotsdir}>" /><br />
					<{$shotsdirhelp}>
				</td>
			</tr>
		<{/if}>
		<tr valign="top" align="left">
			<td class="head"><label for="cat_weight"><{$smarty.const._MD_D3DOWNLOADS_CATWEIGHT}></label></td>
			<td class="even">
				<input type="text" name="cat_weight" id="cat_weight" size="5" maxlength="5" value="<{$categorydata.cat_weight}>" />
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><label for="maincategory"><{$smarty.const._MD_D3DOWNLOADS_MAINCATEGORY}></label></td>
			<td class="even">
				<select name="maincategory" id="maincategory"><br>
					<{html_options options=$maincategory selected=$categorydata.pid}><br>
				</select>
			</td>
		</tr>
		<tr valign="top" align="left">
			<td class="head"><label for="submit_message"><{$smarty.const._MD_D3DOWNLOADS_SUBMIT_MESSAGE}></label><br />
			<{$smarty.const._MD_D3DOWNLOADS_SUBMIT_MESSAGE_HELP}>
			</td>
			<td class="even">
				<textarea name="submit_message" id="css" cols="60" rows="10"><{$categorydata.submit_message}></textarea>
			</td>
		</tr>
	</table>
<{if $categorydata.pid eq 0}>
	<h2><{$smarty.const._MD_D3DOWNLOADS_H2USERACCESS}></h2>
	<table class="outer">
		<tr>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_GROUPNAME}>
				</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_CAN_READ}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_1_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_CAN_POST}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_2_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_CAN_EDIT}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_3_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_CAN_DELETE}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_4_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_POST_AUTO_APPROVED}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_5_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_EDIT_AUTO_APPROVED}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_6_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			<th>
				<{$smarty.const._MD_D3DOWNLOADS_TH_CAN_HTML}>
				<input type="checkbox" onclick="with(document.categoryform){for(i=0;i<length;i++){if(elements[i].type=='checkbox'&&elements[i].id.indexOf('gcol_7_')>=0){elements[i].checked=this.checked;}}}">
			</th>
			</tr>
			<{$group_trs}>
		</table>
<{/if}>
		<br />
		<table class="outer">
			<tr valign="top" align="center">
				<td colspan="5" class="even">
					<input type="submit" class="formButton" name="categoryform_post" id="categoryform_post" value="<{$smarty.const._MD_D3DOWNLOADS_BTN_SUBMITEDITING}>" />
					<input type="submit" name="categoryform_delete" value="<{$smarty.const._DELETE}>" onclick="return confirm('<{$smarty.const._MD_D3DOWNLOADS_CONFIRM_CATEGORY_DEL}>')" />
					<input name="back" type="button" value="<{$smarty.const._MD_D3DOWNLOADS_BTN_CANSEL}>" onclick='location.href="<{$mod_url}>/admin/index.php?page=categorymanager"'/>
				</td>
			</tr>
		</table>
	</form>
<{if $categorydata.pid eq 0}>
	<{$smarty.const._MD_D3DOWNLOADS_HELP_USERACCESS}><br />
<{else}>
	<{$smarty.const._MD_D3DOWNLOADS_HELP_USERACCESS_PID}><br />
<{/if}>
	<{$smarty.const._MD_D3DOWNLOADS_HELP_CATEGORY_DEL}>
<!-- Start Form Vaidation JavaScript //-->
<script type="text/javascript">
<!--//
function xoopsFormValidate_contentform() {
	myform = window.document.categoryform;
	if ( myform.title.value == "" ) {
		window.alert("<{$smarty.const._MD_D3DOWNLOADS_SUBJECT|string_format:$smarty.const._FORM_ENTER}>");
		myform.title.focus();
		myform.title.style.backgroundColor='#FFFFCC';
		return false;
	}
	return true;
}
//-->
</script>
<!-- End Form Vaidation JavaScript //-->
